#include "stdafx.h"
#include "LogActor.h"
#include "EventInterface.h"
#include <strstream>

bool CLogActor::_Receive( TEvent event )
{
    std::ostrstream oss;
    event->Serialize(oss);
    LOG(CRITICAL) << "Message["<< event->GetName() << "]: " << oss.str();
    return true;
}

bool CLogActor::_ReceiveException( tbb::tbb_exception& e, TEvent event )
{
    LOG(CRITICAL) << "Exception:[actor:" << event->GetSender()->GetTypeName() << "] " << e.what();
    _Receive(event);
    return true;
}
